Skip to content

Add nub to recognised package managers#14595

Open
colinhacks wants to merge 3 commits into
cloudflare:mainfrom
colinhacks:add-nub-package-manager
Open

Add nub to recognised package managers#14595
colinhacks wants to merge 3 commits into
cloudflare:mainfrom
colinhacks:add-nub-package-manager

Conversation

@colinhacks

@colinhacks colinhacks commented Jul 8, 2026

Copy link
Copy Markdown

Sorry for the turnover here. Nub has now added its own nub.lock lockfile (was previously piggybacking on other lockfiles) so best practices for detection have changed. Thanks!


Adds a NubPackageManager descriptor to @cloudflare/workers-utils so projects managed by nub are recognised.

nub is a package manager with a pnpm-compatible CLI. Its lock file is nub.lock (pnpm-v9 lockfile format). The new descriptor lets lock-file-based detection identify a nub-managed project, alongside the existing npm/pnpm/yarn/bun entries.

The change is additive:

  • NubPackageManager in packages/workers-utils/src/package-manager.ts, mirroring the bun descriptor's shape (npx: "nubx", dlx: ["nubx"], lockFiles: ["nub.lock"]), with "nub" added to the PackageManager["type"] union.
  • Exported from the package's index.ts.
  • A test covering the descriptor and its lock-file detection.

Scoped to @cloudflare/workers-utils only.


Open in Devin Review

Add a NubPackageManager descriptor so projects with a nub.lock lock file are detected as nub-managed.
Copilot AI review requested due to automatic review settings July 8, 2026 03:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1e4f3db

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@cloudflare/workers-utils Patch
@cloudflare/autoconfig Patch
@cloudflare/cli-shared-helpers Patch
@cloudflare/deploy-helpers Patch
@cloudflare/workers-auth Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@workers-devprod workers-devprod requested review from a team and edmundhung and removed request for a team July 8, 2026 03:29
@workers-devprod

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/nub-package-manager.md: [@cloudflare/wrangler]
  • packages/workers-utils/src/index.ts: [@cloudflare/wrangler]
  • packages/workers-utils/src/package-manager.ts: [@cloudflare/wrangler]
  • packages/workers-utils/tests/package-manager.test.ts: [@cloudflare/wrangler]

devin-ai-integration[bot]

This comment was marked as resolved.

Per REVIEW.md, changesets target users rather than maintainers and should
avoid naming internal constructs. Drops the `NubPackageManager` descriptor
reference flagged in review.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 0 new potential issues.

Open in Devin Review

Adding one entry to the recognised-package-manager list is additive,
same scale as the D1-bindings validation changeset (cloudflare#14530), not a
headline feature on the order of cloudflare#14474 (cache options for
WorkerEntrypoint exports) — patch fits workers-utils' own convention
better than minor.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

Open in Devin Review

@@ -0,0 +1,7 @@
---
"@cloudflare/workers-utils": patch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changeset incorrectly classified as patch instead of minor for a new feature

The new package manager support is classified as a patch release (.changeset/nub-package-manager.md:2) instead of minor, even though it adds a new public export and extends the type union.

Impact: The release version number will not correctly signal to consumers that new API surface was added.

REVIEW.md semver classification rule violation

REVIEW.md explicitly states that "new API capabilities or exports" and "behavior changes that add functionality" should be classified as minor. This PR adds NubPackageManager as a new export from @cloudflare/workers-utils (packages/workers-utils/src/index.ts:153) and extends the PackageManager type union with "nub" (packages/workers-utils/src/package-manager.ts:7). Both of these are new API capabilities.

REVIEW.md also notes: "The description text matters less than the actual change. A changeset described as 'Support X' is adding a new feature (minor)." The changeset description "Add nub to the list of recognised package managers" is clearly adding support for something new.

Suggested change
"@cloudflare/workers-utils": patch
"@cloudflare/workers-utils": minor
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +59 to +64
export const NubPackageManager = {
type: "nub",
npx: "nubx",
dlx: ["nubx"],
lockFiles: ["nub.lock"],
} as const satisfies PackageManager;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Downstream package manager detection logic does not handle nub

The PR adds NubPackageManager as a data constant and export, but none of the downstream detection/resolution code has been updated to recognize nub:

  • Wrangler's getPackageManager() (packages/wrangler/src/package-manager.ts:23-68) checks for npm, yarn, pnpm, and bun only — no supportsNub() check, no user-agent sniffing for nub.
  • Wrangler's sniffUserAgent() (packages/wrangler/src/package-manager.ts:114) returns "npm" | "pnpm" | "yarn" | "bun" | undefined — no "nub" variant.
  • Autoconfig's convertDetectedPackageManager() (packages/autoconfig/src/details/framework-detection.ts:150-168) switches on pnpm/yarn/bun/npm with a default fallback to npm — nub would silently fall back to npm.
  • Create-cloudflare's detectPackageManager() (packages/create-cloudflare/src/helpers/packageManagers.ts:34-87) similarly has no nub case.

This may be intentional if the PR is a first step (adding the constant so consumers can reference it), but if the goal is full nub support, these detection paths need updating. The changeset description says "Projects using nub can now be automatically detected by their nub.lock file" which implies detection should work, but the only detection shown is in the test's local findByLockFile helper — not in any shipped code.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

3 participants